== is the equality operator that performs type coercion, meaning it converts the operands to the same type before making the comparison.
=== is the strict equality operator that compares both value and type without performing type
You need to check if a variable userId equals the string '123'. Which operator would you use and why?
If you write if (value == null) { ... }, what values will cause the block to run? Explain the behavior.
Given let a = '0'; let b = 0;, what will a == b and a === b evaluate to? Explain.
While debugging a feature, you notice that a condition using == is unexpectedly true for an object. Walk me through how you would investigate and fix it.
Your team wants to enforce consistent equality checks across the codebase. What trade‑offs would you consider when introducing a lint rule to ban ==?
A JSON API returns numbers as strings, and a comparison using === fails. How would you handle this without introducing bugs elsewhere?
You are refactoring a large legacy module that heavily uses ==. Describe a systematic approach to migrate to === while minimizing regression risk.
In a performance‑critical loop, you need to compare primitive values. Discuss any measurable impact of using === vs == and how you would benchmark it.
Your microservice communicates with a loosely typed client that sometimes sends booleans as 'true' strings. How would you design a validation layer that correctly handles equality without relying on coercion?
Your organization is planning a migration from a mixed JavaScript/TypeScript codebase to strict TypeScript. How would you address the widespread use of == in terms of tooling, code reviews, and long‑term maintainability?
When defining a shared utility library used across multiple teams, what guidelines would you set regarding equality operators, and how would you enforce them across CI pipelines?
Consider a large monorepo where some packages target older browsers that lack Object.is. How would you decide between using ===, a polyfilled Object.is, or a custom equality helper for consistency?